Skip to content

pick-git-annex-build: sort runs ourselves, log the listing, allow pinning - #16

Merged
yarikoptic merged 1 commit into
masterfrom
claude/gifted-tesla-t2e1ww
Sep 29, 2026
Merged

yarikoptic merged 1 commit into
masterfrom
claude/gifted-tesla-t2e1ww

Conversation

@yarikoptic-gitmate

Copy link
Copy Markdown

Why

In run 36491628696 (the push that merged #15), every git-annex cell ended up incomplete. The picker chose con/git-annex run 35319817132 from 2026-09-18, which has no OsPath build. install-git-annex-daily.sh then rejected it with lacks expected build flag(s): OsPath, so the suite never ran.

The same picker code chose different runs within a few hours:

eval-under run time (UTC) picked
36474925244 19:49 35319817132 (09-18) ✗
36475373813 19:58 36399800528 (09-28) ✓
36484607563 21:13 36399800528 (09-28) ✓
36491628696 22:18 35319817132 (09-18) ✗

The picker logs every run of a matching event type, and in the failed run it logged only the 09-18 one. So either the API listed that run above the newer ones, or the newer ones weren't in its answer at all. That log can't tell the two apart.

What

  • One query per event (&event=schedule, &event=workflow_dispatch), so the API does the filtering and the 30 runs per query reach further back. The results are merged and sorted by created_at in the script; the API's order isn't documented. This fixes the case where the runs came back in the wrong order.
  • One log line per event giving the number of runs listed and the newest one. The next time this happens, that line shows whether the listing was stale or mis-ordered.
  • ::warning:: when the chosen run is more than GIT_ANNEX_BUILD_MAX_AGE days old (default 3; the build runs daily). It's written to stderr so it doesn't end up in the $(...) capture in install-git-annex-daily.sh. It doesn't fail the job, because the OsPath check already does that.
  • New git-annex-run input for workflow_dispatch in test.yaml, passed to the picker as GIT_ANNEX_RUN_ID. It lets you pin a known build, e.g. 36399800528. The pinned run is still checked for a package artifact.

Limits

  • Stale listing: if the API's answer really is stale, sorting can't pick a run it doesn't return. The cells will still be incomplete, which is correct because the build isn't OsPath, but the new log line and warning will say why.
  • Pinned run fails the check: if the pinned run has no package, the matrix step fails. It is continue-on-error, so the cells then fall back to picking a build themselves.

Testing

  • bin/ci/run-checks.sh passes: shellcheck on 26 scripts, known-issues validation, unit tests.
  • Ran the picker against a stub gh:
    • runs listed oldest first: now picks 36399800528
    • only old runs listed: warns
    • pinned run: uses it
    • pinned run without a package: fails

🤖 Generated with Claude Code

https://claude.ai/code/session_0112v9r8Yrb9zytWDMmC9dZ2


Generated by Claude Code

…ning

In eval-under run 36491628696 (push to master, 22:18 UTC) the picker
took con/git-annex run 35319817132 (2026-09-18, no OsPath) as the newest
schedule/workflow_dispatch master run with a package, although at 19:58
and 21:13 the same code picked 36399800528 (2026-09-28). The OsPath
check in install-git-annex-daily.sh rejected the build, so every
git-annex cell ended "incomplete". The loop logs each matching
candidate, and only the 09-18 run was logged: the API either listed it
above the newer runs or did not list them at all. We cannot tell which
from that log.

- One runs query per event (`&event=...`), so filtering is server-side
  and $GIT_ANNEX_BUILD_SCAN covers more history; the pages are merged
  and sorted by created_at here instead of trusting the API's
  (undocumented) order. Fixes the mis-ordered case.
- Log, per event, how many runs were listed and the newest one, so a
  stale listing is distinguishable from a mis-ordered one next time.
- ::warning:: (stderr, so the `$(...)` capture in
  install-git-annex-daily.sh stays clean) when the pick is older than
  GIT_ANNEX_BUILD_MAX_AGE days (default 3; the build is daily). Not
  fatal: the OsPath check already fails the cell.
- test.yaml: workflow_dispatch input `git-annex-run`, passed to the
  picker as GIT_ANNEX_RUN_ID, to pin a known build (e.g. 36399800528)
  while the listing misbehaves. A pinned run is still checked for a
  package artifact.

Tested: bin/ci/run-checks.sh (shellcheck 26 scripts, known-issues,
unit tests); the picker against a stub gh for a mis-ordered listing
(now picks 36399800528), an old-only listing (warns), a pinned run, and
a pinned run without a package (fails).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0112v9r8Yrb9zytWDMmC9dZ2
@yarikoptic
yarikoptic merged commit e8b1291 into master Sep 29, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants